﻿<UserControl x:Class="HelloWorld.Views.Home.Menu"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Home="clr-namespace:HelloWorld.ViewModels.Home"
             xmlns:Commands="clr-namespace:Phoenix.Commands;assembly=Phoenix"
             xmlns:Transitions="clr-namespace:Phoenix.Frames.Transitions;assembly=Phoenix"
             d:DataContext="{d:DesignInstance Home:MenuViewModel}"
             d:DesignHeight="300"
             d:DesignWidth="300"
             mc:Ignorable="d">
    <Transitions:TransitionService.NavigateForwardTransition>
        <Transitions:SlideTransition Direction="Forward" />
    </Transitions:TransitionService.NavigateForwardTransition>
    <Transitions:TransitionService.NavigateBackTransition>
        <Transitions:SlideTransition Direction="Back" />
    </Transitions:TransitionService.NavigateBackTransition>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Button Content="&lt;- Back"
                Command="{Binding BackCommand}">
            <Button.Style>
                <Style TargetType="Button">
                    <Style.Triggers>
                        <Trigger Property="IsEnabled"
                                 Value="False">
                            <Setter Property="Visibility"
                                    Value="Collapsed" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Button.Style>
        </Button>

        <ListBox x:Name="menuItems"
                 Grid.Row="1"
                 Commands:InvokeCommand.OnItemSelected="{Binding MenuItemSelectedCommand}"
                 ItemsSource="{Binding MenuItems}">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Label Content="{Binding Text}" />
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>
